import type { orderInfo } from '@/api/modules/types/assets'

export function useInitForm(): { formData: Ref<orderInfo>, initForm: () => void } {
  const getData = (): orderInfo => ({
    Remark: '',
    PlaceDate: '',
    AssetFactoryObjId: '',
    AssetModelObjID: '',
    AssetCodeYear: 0,
    AssetCodeBatch: '',
    RecAddress: '',
    StipulateDate: '',
    Recipient: '',
    RecipientTel: '',
    AssetModelClassifyName: '',
    AssetModelClassifyObjID: 0,
    OrderFormCode: '',
    ObjID: '',
    AssetCodeSNEnd: 0,
    AssetCodeSNStart: 0,
    AssetFactoryName: '',
    SellTime: '',
    AssetModelName: '',
    AssetCode: '',
    StateName: '',
    OrderFormObjID: '',
    AssetObjID: '',
  })
  const formData = ref<orderInfo>(getData())

  const initForm = () => {
    formData.value = getData()
  }

  return { formData, initForm }
}
